package bookExercise;

import java.text.SimpleDateFormat;
import java.util.Date;

public class A8Test {
    public String format(Date date){
        SimpleDateFormat adf =new SimpleDateFormat("yyyy-MM-dd");
        return adf.format(date);
    }
    public static void main(String[] args) {
        A8Test obj = new A8Test();
        A8 im = obj::format;
        Date date =new Date();
        System.out.println("默认格式"+date);
        System.out.println("自定义格式"+im.method(date));
    }


}
